|
|
|
|
|
|
|
Open/Save Address Book Database |
|
|
|
|
|
|
|
|
These options would be grouped into only a few main menu options that should remain consistent with the Windows standard interface. |
|
|
|
|
|
|
|
|
From this diagram, you can now add the menu to the MDI form. You must make one other design decision before actually creating the menu. That is whether to use unique names for each menu option or to create a menu collection array to work with. Each of these has good points and bad points. |
|
|
|
|
|
|
|
|
Using unique names for each option will let you separate each menu option routine. This makes the maintenance of the menu code a little easier to follow because you can find a particular menu routine by clicking on the menu option directly while in design mode. It does, however, create more subroutines for the application to keep track of. On the other hand, using the collections array to handle the menu options keeps all of the menu code in one routine. This enables you to centralize the menu code; however, you must use select statements to recognize which menu option was selected. Listings 7.1 and 7.2 show you the difference between each of the coding choices. |
|
|
|
|
|
|
|
|
LISTING 7.1. MENUOPTIONS.TXTUSING UNIQUE MENU OPTION NAMES REQUIRES DIFFERENT EVENT ROUTINES FOR EACH MENU OPTION. |
|
|
|
 |
|
|
|
|
1: Private Sub mnuFileSaveAll_Click()
2: ToDo: Add mnuFileSaveAll_Click code.
3: MsgBox Add mnuFileSaveAll_Click code.
4: End Sub
5:
6: Private Sub mnuFileSaveAs_Click()
7: ToDo: Add mnuFileSaveAs_Click code.
8: MsgBox Add mnuFileSaveAs_Click code.
9: End Sub
10:
11: Private Sub mnuFileSave_Click()
12: ToDo: Add mnuFileSave_Click code.
13: MsgBox Add mnuFileSave_Click code.
14: End Sub |
|
|
|
|
|